package Homework;

import java.util.Scanner;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-07-06 18:36
 * @description: Functions of this class is 整数反转
 **/
public class A1 {
    public static void main(String args[]){
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int n=scanner.nextInt();
            System.out.println(reverse(n));
        }
    }
    private static int reverse(int n){
        int ans=0;
        int len=0;
        int num=n;
        while (num!=0){
            len++;
            num/=10;
        }
        double k=Math.pow(10,len-1);
        while (len--!=0){
            ans+=k*(n%10);
            n/=10;
            k/=10;
        }
        return ans;
    }
}